import {
    logout
} from '../../../api/myzone'
Page({
    data: {
        version: '',
        showState: false
    },
    onLoad() {
        const accountInfo = wx.getAccountInfoSync();
        this.setData({
            version: accountInfo.miniProgram.version
        })
    },
    async logoutFun() {
        const ret = await logout();
        wx.setStorageSync('Authorization', '');
        wx.switchTab({
            url: `/pages/home/home`,
        });

    },
    showDialog(e) {
        this.setData({
            showState: true
        })
    },
    closeDialog() {
        this.setData({
            showState: false
        })
    },
    confirmDialog() {
        this.closeDialog();
        this.logoutFun();
    },
    onShareAppMessage() {
        return {};
    },
});